<?php 
session_start();
if (!isset($_SESSION['user'])) {
	
	header("Location: index.php");
}
function __autoload($class_name) {
	include $class_name.'.php';
}
$currUsername = $_SESSION['user']->getUsername();
$currProfile = new Profile($currUsername);

if(isset($_GET['action']) && $_GET['action'] == "logout") {
	
	Utils::logoutUser();
}

$currentUser = $currProfile->getUser();
if(!$currentUser->checkIfLocked()) {
	
	header('Location: office.php');
}
echo '<html>
	<head>
		<meta charset="utf-8">
		<title>Офис войни</title>
		<link href="css/beerWorldStyle.css" rel="stylesheet" type="text/css">
		<script src="js/jquery-1.11.1.min.js"></script>
		<script src="js/indexJS.js" charset="utf-8"></script>
		<script src="js/ajax.js"></script>
	</head>
	<body>
</html>';